home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: iiasa.ac.at!marek
- From: marek@iiasa.ac.at (Marek MAKOWSKI)
- Subject: nested va_list
- Message-ID: <1996Jan26.180430.22340@iiasa.ac.at>
- Organization: IIASA, Laxenburg, Austria
- X-Newsreader: TIN [version 1.2 PL2]
- Date: Fri, 26 Jan 1996 18:04:30 GMT
-
- This might be an easy problem:
- I want to call from a function with variable number of parameters
- another function and pass the parameters without processing.
- I would appreciate comments, if there exists a robust and
- portable way to do it.
- For example:
-
- #include <stdarg.h>
-
- void X::g(const char *fmt, ...) {
- va_list lstp;
- va_start(lstp, format);
- // s is space allocated in X
- (void) vsprintf(s, format, lstp);
- va_end(lstp);
- //
- }
-
- void X::f(const char *fmt, ...) {
- // I want to avoid processing the arguments here before calling g();
- g( ????? );
- }
-
- Thanks in advance,
- Marek
- --
- Marek Makowski | Email: marek@iiasa.ac.at
- International Institute | Phone: (+43-2236) 807.561
- for Applied Systems Analysis | Fax: (+43-2236) 71.313
- A-2361 Laxenburg, Austria | Web: http://www.iiasa.ac.at
-